package com.utils.report;

import java.io.OutputStream;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import net.sf.jxls.util.Util;

import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
/**
 * 特殊打印抽象处理类
 *
 */
public abstract class ExcelTsPrint extends ExcelPrint {
	private OutputStream out;
	private HttpServletRequest request;
	private HttpSession session;
	protected Workbook hssfWorkbook = null;
	protected Sheet sheet0 = null;
	
	public OutputStream getOut() {
		return out;
	}

	public void setOut(OutputStream out) {
		this.out = out;
	}

	public HttpServletRequest getRequest() {
		return this.request;
	}
	
	public void setRequest(HttpServletRequest request) {
		this.request = request;
		this.session=this.request.getSession();
	}

	protected String getParameterFromRequest(String param_name) {
		if (this.request == null)
			return null;
		return this.request.getParameter(param_name);
	}

	protected Object getAttributeFromSession(String attribtue_name) {
		if (this.session == null)
			return null;
		return this.session.getAttribute(attribtue_name);
	}
	
	public Sheet CopySheet(Sheet newsheet,Sheet sheet02){
        Util.copySheets(newsheet,sheet02,"","");
        ExcelUtil.copyPageSetup(newsheet, sheet02);
        ExcelUtil.copyPrintSetup(newsheet, sheet02);
        ExcelUtil.copyPrintMargin(newsheet, sheet02);
		return newsheet;
	}
	
	public abstract void tsPrint(Workbook hssfWorkbook2,Sheet sheet2);
	
	@Override
	public void printList() {
		// TODO Auto-generated method stub
	}
}
